const express=require('express')
const mysql=require('mysql')
const database=require('../database')
// 实例化服务器对象
const goods=express.Router()
goods.use(express.urlencoded({extended:false}))
goods.use(express.json())
const db=mysql.createPool(database)
// 请在此处编写接口程序，参考index.js.bak
goods.post('/getMember',(req,res)=>{
    let sql='selct * from t_member where memberPhone=? and password=?'
    db.query(sql,[req.body.memberPhone,req.body.password],(err,result)=>{
        if(result.length){
            res.send({
                success:true,
                msg:'成功'
            })
        }else{
            res.send({
                success:false,
                msg:'失败'
            })
        }
    })
})
module.exports=goods